package com.rising.face.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

public class CglibTest {

    public static void main(String[] args) {
        /*DoneYundong doneYundong = new MyMethodInterceptor().createProcy();
        doneYundong.doneSomeThing("hahhahhah=====");*/
        /*Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(DoneYundong.class);
        enhancer.setCallback(new YunDongMethodInterceptor());
        DoneYundong doneYundong = (DoneYundong) enhancer.create();
        doneYundong.doneSomeThing("跑步十分钟");*/

        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(DoneYundong.Sel.class);
        enhancer.setCallback(new YunDongMethodInterceptor());
        DoneYundong.Sel sel = (DoneYundong.Sel) enhancer.create();
        sel.sell("跑步十分钟");
    }
}
